package week3;
//**************************************************************************************************
//                     pp3_9.java           Author:Duanzhixuan
//              输出随机数，并计算圆柱体的体积和表面积。
//**************************************************************************************************

import java.util.Random;

public class pp3_9 {
    public static void main(String[] args) {
        Random generator = new Random();
        int r,h;
        double V,S;

        r = generator.nextInt(21);
        h = generator.nextInt(21);
        System.out.println("半径为：" + r);
        System.out.println("高度为：" + h);

        V = Math.PI*Math.pow(r,2)*h;
                S = 2 * Math.PI*r*h;
        System.out.println("体积为："+V);
        System.out.println(("表面积为："+S));
    }
}
